package router

import (
	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
	"jgt-oper/src/context"
	"jgt-oper/src/web"
)

// WebSVMap web-special-visit 注册路由映射
func WebSVMap(g *inject.Graph, r *gear.Router) {
	a := new(web.SVController)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}

	r.Get("/special-visit/page", context.WrapContext(a.QVisitPage))
	r.Post("/special-visit/create", context.WrapContext(a.AddVisit))
	r.Get("/special-visit/detail/:id", context.WrapContext(a.QVisitDetail))
	r.Put("/special-visit/cancel/:id", context.WrapContext(a.Cancel))
	r.Put("/special-visit/resend/:id", context.WrapContext(a.Resend))
}
